package cn.tedu.oop;

/**该类用于构造函数的巩固练习
 * @author ：Dsi
 * @date ：2021/11/8 11:08
 */
public class TestCast {
    public static void main(String[] args) {
        Cat c = new Cat("1");
        Cat c1=new Cat("xX",12,456);
        Cat c2=new Cat();
    }

}
class Cat{
    String name;
    int age;
    double price;
    public void play(){
        System.out.println("正在扑蝴蝶~~~~~~~");
    }

    public Cat(){
        System.out.println("我是无参构造");
    }
    public Cat(String a){
        System.out.println("我是含参构造"+a);
    }
    public Cat(String name, int age, double price) {
        this.name = name;
        this.age = age;
        this.price = price;
        System.out.println("我是全参构造");
        System.out.println(name);
    }
}